*------------------------------------------------------------------------------*
* Family history - Dinas, Fouka, Schläpfer - JoP
*------------------------------------------------------------------------------*

*------------------------------------------------------------------------------*
* Figure D6
*------------------------------------------------------------------------------*

clear all
set obs 21

gen greek_share=0.15+(_n-1)*0.01
gen german_share=0.05+(_n-1)*0.01

gen greek_b_To=-0.022
gen greek_a_To=-0.03
gen greek_b_Td=greek_b_To+0.19
gen greek_a_Td=greek_a_To+0.14

gen german_b_To=-0.11
gen german_a_To=-0.11
gen german_b_Td=german_b_To+0.19
gen german_a_Td=german_a_To+0.32


foreach mes in a b {
	foreach ctry in greek german {
		gen effect_`ctry'_`mes'=(1-`ctry'_share)*`ctry'_`mes'_To+`ctry'_share*`ctry'_`mes'_Td
	}
}

twoway 	(line effect_greek_b greek_share, color(blue)) ///
		(line effect_greek_a greek_share, color(red)), ///
		legend(off) ///
		xtitle("Share of Asia Minor descendants") ytitle("Treatment Effect") ///
		scheme(s1color) aspect(1) subtitle("Greece") yline(0, lcolor(black)) ///
		xline(0.25, lcolor(gs7) lpattern(dash)) yscale(range(-0.1 0.1)) ylabel(-0.1(0.025)0.1)
		
graph save greek_effect, replace


twoway 	(line effect_german_b german_share, color(blue)) ///
		(line effect_german_a german_share, color(red)), ///
		legend(off) ///
		xtitle("Share of refugee descendants") ytitle("Treatment Effect") ///
		legend(row(2) order(1 "Quasi-behavioral/Donation" 2 "Attitudes") ring(0) position(8) bmargin(none) size(small) region(lc(none) fc(none) ls(none)) symxsize(large)) ///
		scheme(s1color) aspect(1) subtitle("Germany") yline(0, lcolor(black)) ///
		xline(0.165, lcolor(gs7) lpattern(dash)) yscale(range(-0.1 0.1)) ylabel(-0.1(0.025)0.1)
		

graph save german_effect, replace

grc1leg greek_effect.gph german_effect.gph, legendfrom(german_effect.gph) position(6) ring(0)

